# -*- coding: utf-8 -*-
"""
@Time ： 2021/7/29 16:44
@Auth ： Mr.掌心 2929184523
@Company ：特斯汀学院 @testingedu.com.cn
@Function ：请输入模块功能描述
"""
from PO.pages.base_page import BasePage


class LoginPage(BasePage):
    LoginPage_locators = {
        '_input_username_locator': '//*[@id="username"]',
        '_input_password_locator': '//*[@id="password"]',
        '_verify_img_locator': '//*[@id="verify_code_img"]',
        '_input_verify_locator': '//*[@id="verify_code"]',
        '_login_button_locator': '//a[@class="J-login-submit"]',
    }

    def login(self, username, password, verify):
        self.input(self.LoginPage_locators['_input_username_locator'], username)
        self.input(self.LoginPage_locators['_input_password_locator'], password)
        self.getverify(self.LoginPage_locators['_verify_img_locator'])
        self.input(self.LoginPage_locators['_input_verify_locator'], verify)
        self.clickjs(self.LoginPage_locators['_login_button_locator'])
